<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QDirModel Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QDirModel Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QDirModel class provides a data model for the local
filesystem. <a href="#details">More...</a></p>

<p>Inherits <a href="qabstractitemmodel.html">QAbstractItemModel</a>.</p><h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qdirmodel.html#Roles-enum">Roles</a></b> { FileIconRole, FilePathRole, FileNameRole }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qdirmodel.html#QDirModel">__init__</a></b> (<i>self</i>, QStringList&#160;<i>nameFilters</i>, QDir.Filters&#160;<i>filters</i>, QDir.SortFlags&#160;<i>sort</i>, QObject&#160;<i>parent</i>&#160;=&#160;None)</li><li><div class="fn" /><b><a href="qdirmodel.html#QDirModel-2">__init__</a></b> (<i>self</i>, QObject&#160;<i>parent</i>&#160;=&#160;None)</li><li><div class="fn" />int <b><a href="qdirmodel.html#columnCount">columnCount</a></b> (<i>self</i>, QModelIndex&#160;<i>parent</i>&#160;=&#160;QModelIndex())</li><li><div class="fn" />QVariant <b><a href="qdirmodel.html#data">data</a></b> (<i>self</i>, QModelIndex&#160;<i>index</i>, int&#160;<i>role</i>&#160;=&#160;Qt.DisplayRole)</li><li><div class="fn" />bool <b><a href="qdirmodel.html#dropMimeData">dropMimeData</a></b> (<i>self</i>, QMimeData&#160;<i>data</i>, Qt.DropAction&#160;<i>action</i>, int&#160;<i>row</i>, int&#160;<i>column</i>, QModelIndex&#160;<i>parent</i>)</li><li><div class="fn" />QIcon <b><a href="qdirmodel.html#fileIcon">fileIcon</a></b> (<i>self</i>, QModelIndex&#160;<i>index</i>)</li><li><div class="fn" />QFileInfo <b><a href="qdirmodel.html#fileInfo">fileInfo</a></b> (<i>self</i>, QModelIndex&#160;<i>index</i>)</li><li><div class="fn" />QString <b><a href="qdirmodel.html#fileName">fileName</a></b> (<i>self</i>, QModelIndex&#160;<i>index</i>)</li><li><div class="fn" />QString <b><a href="qdirmodel.html#filePath">filePath</a></b> (<i>self</i>, QModelIndex&#160;<i>index</i>)</li><li><div class="fn" />QDir.Filters <b><a href="qdirmodel.html#filter">filter</a></b> (<i>self</i>)</li><li><div class="fn" />Qt.ItemFlags <b><a href="qdirmodel.html#flags">flags</a></b> (<i>self</i>, QModelIndex&#160;<i>index</i>)</li><li><div class="fn" />bool <b><a href="qdirmodel.html#hasChildren">hasChildren</a></b> (<i>self</i>, QModelIndex&#160;<i>parent</i>&#160;=&#160;QModelIndex())</li><li><div class="fn" />QVariant <b><a href="qdirmodel.html#headerData">headerData</a></b> (<i>self</i>, int&#160;<i>section</i>, Qt.Orientation&#160;<i>orientation</i>, int&#160;<i>role</i>&#160;=&#160;Qt.DisplayRole)</li><li><div class="fn" />QFileIconProvider <b><a href="qdirmodel.html#iconProvider">iconProvider</a></b> (<i>self</i>)</li><li><div class="fn" />QModelIndex <b><a href="qdirmodel.html#index">index</a></b> (<i>self</i>, int&#160;<i>row</i>, int&#160;<i>column</i>, QModelIndex&#160;<i>parent</i>&#160;=&#160;QModelIndex())</li><li><div class="fn" />QModelIndex <b><a href="qdirmodel.html#index-2">index</a></b> (<i>self</i>, QString&#160;<i>path</i>, int&#160;<i>column</i>&#160;=&#160;0)</li><li><div class="fn" />bool <b><a href="qdirmodel.html#isDir">isDir</a></b> (<i>self</i>, QModelIndex&#160;<i>index</i>)</li><li><div class="fn" />bool <b><a href="qdirmodel.html#isReadOnly">isReadOnly</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qdirmodel.html#lazyChildCount">lazyChildCount</a></b> (<i>self</i>)</li><li><div class="fn" />QMimeData <b><a href="qdirmodel.html#mimeData">mimeData</a></b> (<i>self</i>, list-of-QModelIndex&#160;<i>indexes</i>)</li><li><div class="fn" />QStringList <b><a href="qdirmodel.html#mimeTypes">mimeTypes</a></b> (<i>self</i>)</li><li><div class="fn" />QModelIndex <b><a href="qdirmodel.html#mkdir">mkdir</a></b> (<i>self</i>, QModelIndex&#160;<i>parent</i>, QString&#160;<i>name</i>)</li><li><div class="fn" />QStringList <b><a href="qdirmodel.html#nameFilters">nameFilters</a></b> (<i>self</i>)</li><li><div class="fn" />QModelIndex <b><a href="qdirmodel.html#parent">parent</a></b> (<i>self</i>, QModelIndex&#160;<i>child</i>)</li><li><div class="fn" />QObject <b><a href="qdirmodel.html#parent-2">parent</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qdirmodel.html#refresh">refresh</a></b> (<i>self</i>, QModelIndex&#160;<i>parent</i>&#160;=&#160;QModelIndex())</li><li><div class="fn" />bool <b><a href="qdirmodel.html#remove">remove</a></b> (<i>self</i>, QModelIndex&#160;<i>index</i>)</li><li><div class="fn" />bool <b><a href="qdirmodel.html#resolveSymlinks">resolveSymlinks</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qdirmodel.html#rmdir">rmdir</a></b> (<i>self</i>, QModelIndex&#160;<i>index</i>)</li><li><div class="fn" />int <b><a href="qdirmodel.html#rowCount">rowCount</a></b> (<i>self</i>, QModelIndex&#160;<i>parent</i>&#160;=&#160;QModelIndex())</li><li><div class="fn" />bool <b><a href="qdirmodel.html#setData">setData</a></b> (<i>self</i>, QModelIndex&#160;<i>index</i>, QVariant&#160;<i>value</i>, int&#160;<i>role</i>&#160;=&#160;Qt.EditRole)</li><li><div class="fn" /><b><a href="qdirmodel.html#setFilter">setFilter</a></b> (<i>self</i>, QDir.Filters&#160;<i>filters</i>)</li><li><div class="fn" /><b><a href="qdirmodel.html#setIconProvider">setIconProvider</a></b> (<i>self</i>, QFileIconProvider&#160;<i>provider</i>)</li><li><div class="fn" /><b><a href="qdirmodel.html#setLazyChildCount">setLazyChildCount</a></b> (<i>self</i>, bool&#160;<i>enable</i>)</li><li><div class="fn" /><b><a href="qdirmodel.html#setNameFilters">setNameFilters</a></b> (<i>self</i>, QStringList&#160;<i>filters</i>)</li><li><div class="fn" /><b><a href="qdirmodel.html#setReadOnly">setReadOnly</a></b> (<i>self</i>, bool&#160;<i>enable</i>)</li><li><div class="fn" /><b><a href="qdirmodel.html#setResolveSymlinks">setResolveSymlinks</a></b> (<i>self</i>, bool&#160;<i>enable</i>)</li><li><div class="fn" /><b><a href="qdirmodel.html#setSorting">setSorting</a></b> (<i>self</i>, QDir.SortFlags&#160;<i>sort</i>)</li><li><div class="fn" /><b><a href="qdirmodel.html#sort">sort</a></b> (<i>self</i>, int&#160;<i>column</i>, Qt.SortOrder&#160;<i>order</i>&#160;=&#160;Qt.AscendingOrder)</li><li><div class="fn" />QDir.SortFlags <b><a href="qdirmodel.html#sorting">sorting</a></b> (<i>self</i>)</li><li><div class="fn" />Qt.DropActions <b><a href="qdirmodel.html#supportedDropActions">supportedDropActions</a></b> (<i>self</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QDirModel class provides a data model for the local
filesystem.</p>
<p>The usage of QDirModel is not recommended anymore. The <a href="qfilesystemmodel.html">QFileSystemModel</a> class is a more
performant alternative.</p>
<p>This class provides access to the local filesystem, providing
functions for renaming and removing files and directories, and for
creating new directories. In the simplest case, it can be used with
a suitable display widget as part of a browser or filer.</p>
<p>QDirModel keeps a cache with file information. The cache needs
to be updated with <a href="qdirmodel.html#refresh">refresh</a>().</p>
<p>QDirModel can be accessed using the standard interface provided
by <a href="qabstractitemmodel.html">QAbstractItemModel</a>, but it
also provides some convenience functions that are specific to a
directory model. The <a href="qdirmodel.html#fileInfo">fileInfo</a>() and <a href="qdirmodel.html#isDir">isDir</a>() functions provide information
about the underlying files and directories related to items in the
model.</p>
<p>Directories can be created and removed using <a href="qdirmodel.html#mkdir">mkdir</a>(), <a href="qdirmodel.html#rmdir">rmdir</a>(), and the model will be
automatically updated to take the changes into account.</p>
<p><b>Note:</b> QDirModel requires an instance of a GUI
application.</p>
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="Roles-enum" />QDirModel.Roles</h3><table class="valuelist">
<tr>
<th class="tblConst">Constant</th>
<th class="tblVal">Value</th>
</tr>
<tr>
<td class="topAlign"><tt>QDirModel.FileIconRole</tt></td>
<td class="topAlign"><tt>Qt.DecorationRole</tt></td>
</tr>
<tr>
<td class="topAlign"><tt>QDirModel.FilePathRole</tt></td>
<td class="topAlign"><tt>Qt.UserRole + 1</tt></td>
</tr>
<tr>
<td class="topAlign"><tt>QDirModel.FileNameRole</tt></td>
<td class="topAlign">?</td>
</tr>
</table>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QDirModel" />QDirModel.__init__ (<i>self</i>, QStringList&#160;<i>nameFilters</i>, <a href="qdir-filters.html">QDir.Filters</a>&#160;<i>filters</i>, <a href="qdir-sortflags.html">QDir.SortFlags</a>&#160;<i>sort</i>, <a href="qobject.html">QObject</a>&#160;<i>parent</i>&#160;=&#160;None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs a new directory model with the given <i>parent</i>.
Only those files matching the <i>nameFilters</i> and the
<i>filters</i> are included in the model. The sort order is given
by the <i>sort</i> flags.</p>


<h3 class="fn"><a name="QDirModel-2" />QDirModel.__init__ (<i>self</i>, <a href="qobject.html">QObject</a>&#160;<i>parent</i>&#160;=&#160;None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs a directory model with the given <i>parent</i>.</p>


<h3 class="fn"><a name="columnCount" />int QDirModel.columnCount (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>parent</i>&#160;=&#160;QModelIndex())</h3><p>Reimplemented from <a href="qabstractitemmodel.html#columnCount">QAbstractItemModel.columnCount</a>().</p>
<p>Returns the number of columns in the <i>parent</i> model
item.</p>


<h3 class="fn"><a name="data" />QVariant QDirModel.data (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>index</i>, int&#160;<i>role</i>&#160;=&#160;Qt.DisplayRole)</h3><p>Reimplemented from <a href="qabstractitemmodel.html#data">QAbstractItemModel.data</a>().</p>
<p>Returns the data for the model item <i>index</i> with the given
<i>role</i>.</p>
<p><b>See also</b> <a href="qdirmodel.html#setData">setData</a>().</p>


<h3 class="fn"><a name="dropMimeData" />bool QDirModel.dropMimeData (<i>self</i>, <a href="qmimedata.html">QMimeData</a>&#160;<i>data</i>, <a href="qt.html#DropAction-enum">Qt.DropAction</a>&#160;<i>action</i>, int&#160;<i>row</i>, int&#160;<i>column</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>parent</i>)</h3><p>Reimplemented from <a href="qabstractitemmodel.html#dropMimeData">QAbstractItemModel.dropMimeData</a>().</p>
<p>Handles the <i>data</i> supplied by a drag and drop operation
that ended with the given <i>action</i> over the row in the model
specified by the <i>row</i> and <i>column</i> and by the
<i>parent</i> index.</p>
<p><b>See also</b> <a href="qdirmodel.html#supportedDropActions">supportedDropActions</a>().</p>


<h3 class="fn"><a name="fileIcon" /><a href="qicon.html">QIcon</a> QDirModel.fileIcon (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>index</i>)</h3><p>Returns the icons for the item stored in the model under the
given <i>index</i>.</p>


<h3 class="fn"><a name="fileInfo" /><a href="qfileinfo.html">QFileInfo</a> QDirModel.fileInfo (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>index</i>)</h3><p>Returns the file information for the specified model
<i>index</i>.</p>
<p><b>Note:</b> If the model index represents a symbolic link in
the underlying filing system, the file information returned will
contain information about the symbolic link itself, regardless of
whether <a href="qdirmodel.html#resolveSymlinks-prop">resolveSymlinks</a> is
enabled or not.</p>
<p><b>See also</b> <a href="qfileinfo.html#symLinkTarget">QFileInfo.symLinkTarget</a>().</p>


<h3 class="fn"><a name="fileName" />QString QDirModel.fileName (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>index</i>)</h3><p>Returns the name of the item stored in the model under the
<i>index</i> given.</p>


<h3 class="fn"><a name="filePath" />QString QDirModel.filePath (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>index</i>)</h3><p>Returns the path of the item stored in the model under the
<i>index</i> given.</p>


<h3 class="fn"><a name="filter" /><a href="qdir-filters.html">QDir.Filters</a> QDirModel.filter (<i>self</i>)</h3><p>Returns the filter specification for the directory model.</p>
<p><b>See also</b> <a href="qdirmodel.html#setFilter">setFilter</a>() and <a href="qdir.html#Filter-enum">QDir.Filters</a>.</p>


<h3 class="fn"><a name="flags" /><a href="qt-itemflags.html">Qt.ItemFlags</a> QDirModel.flags (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>index</i>)</h3><p>Reimplemented from <a href="qabstractitemmodel.html#flags">QAbstractItemModel.flags</a>().</p>
<p>Returns the item flags for the given <i>index</i> in the
model.</p>
<p><b>See also</b> <a href="qt.html#ItemFlag-enum">Qt.ItemFlags</a>.</p>


<h3 class="fn"><a name="hasChildren" />bool QDirModel.hasChildren (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>parent</i>&#160;=&#160;QModelIndex())</h3><p>Reimplemented from <a href="qabstractitemmodel.html#hasChildren">QAbstractItemModel.hasChildren</a>().</p>
<p>Returns true if the <i>parent</i> model item has children;
otherwise returns false.</p>


<h3 class="fn"><a name="headerData" />QVariant QDirModel.headerData (<i>self</i>, int&#160;<i>section</i>, <a href="qt.html#Orientation-enum">Qt.Orientation</a>&#160;<i>orientation</i>, int&#160;<i>role</i>&#160;=&#160;Qt.DisplayRole)</h3><p>Reimplemented from <a href="qabstractitemmodel.html#headerData">QAbstractItemModel.headerData</a>().</p>
<p>Returns the data stored under the given <i>role</i> for the
specified <i>section</i> of the header with the given
<i>orientation</i>.</p>


<h3 class="fn"><a name="iconProvider" /><a href="qfileiconprovider.html">QFileIconProvider</a> QDirModel.iconProvider (<i>self</i>)</h3><p>Returns the file icon provider for this directory model.</p>
<p><b>See also</b> <a href="qdirmodel.html#setIconProvider">setIconProvider</a>().</p>


<h3 class="fn"><a name="index" /><a href="qmodelindex.html">QModelIndex</a> QDirModel.index (<i>self</i>, int&#160;<i>row</i>, int&#160;<i>column</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>parent</i>&#160;=&#160;QModelIndex())</h3><p>Reimplemented from <a href="qabstractitemmodel.html#index">QAbstractItemModel.index</a>().</p>
<p>Returns the model item index for the item in the <i>parent</i>
with the given <i>row</i> and <i>column</i>.</p>


<h3 class="fn"><a name="index-2" /><a href="qmodelindex.html">QModelIndex</a> QDirModel.index (<i>self</i>, QString&#160;<i>path</i>, int&#160;<i>column</i>&#160;=&#160;0)</h3><p>This is an overloaded function.</p>
<p>Returns the model item index for the given <i>path</i>.</p>


<h3 class="fn"><a name="isDir" />bool QDirModel.isDir (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>index</i>)</h3><p>Returns true if the model item <i>index</i> represents a
directory; otherwise returns false.</p>


<h3 class="fn"><a name="isReadOnly" />bool QDirModel.isReadOnly (<i>self</i>)</h3><h3 class="fn"><a name="lazyChildCount" />bool QDirModel.lazyChildCount (<i>self</i>)</h3><h3 class="fn"><a name="mimeData" /><a href="qmimedata.html">QMimeData</a> QDirModel.mimeData (<i>self</i>, list-of-QModelIndex&#160;<i>indexes</i>)</h3><p>The <i>QMimeData</i> result</p><p>Reimplemented from <a href="qabstractitemmodel.html#mimeData">QAbstractItemModel.mimeData</a>().</p>
<p>Returns an object that contains a serialized description of the
specified <i>indexes</i>. The format used to describe the items
corresponding to the indexes is obtained from the <a href="qdirmodel.html#mimeTypes">mimeTypes</a>() function.</p>
<p>If the list of indexes is empty, 0 is returned rather than a
serialized empty list.</p>


<h3 class="fn"><a name="mimeTypes" />QStringList QDirModel.mimeTypes (<i>self</i>)</h3><p>Reimplemented from <a href="qabstractitemmodel.html#mimeTypes">QAbstractItemModel.mimeTypes</a>().</p>
<p>Returns a list of MIME types that can be used to describe a list
of items in the model.</p>


<h3 class="fn"><a name="mkdir" /><a href="qmodelindex.html">QModelIndex</a> QDirModel.mkdir (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>parent</i>, QString&#160;<i>name</i>)</h3><p>Create a directory with the <i>name</i> in the <i>parent</i>
model item.</p>


<h3 class="fn"><a name="nameFilters" />QStringList QDirModel.nameFilters (<i>self</i>)</h3><p>Returns a list of filters applied to the names in the model.</p>
<p><b>See also</b> <a href="qdirmodel.html#setNameFilters">setNameFilters</a>().</p>


<h3 class="fn"><a name="parent" /><a href="qmodelindex.html">QModelIndex</a> QDirModel.parent (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>child</i>)</h3><p>Reimplemented from <a href="qabstractitemmodel.html#parent">QAbstractItemModel.parent</a>().</p>
<p>Return the parent of the given <i>child</i> model item.</p>


<h3 class="fn"><a name="parent-2" /><a href="qobject.html">QObject</a> QDirModel.parent (<i>self</i>)</h3><h3 class="fn"><a name="refresh" />QDirModel.refresh (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>parent</i>&#160;=&#160;QModelIndex())</h3><p><a class="obsolete" href="qdirmodel.html">QDirModel</a> caches
file information. This function updates the cache. The
<i>parent</i> parameter is the directory from which the model is
updated; the default value will update the model from root
directory of the file system (the entire model).</p>


<h3 class="fn"><a name="remove" />bool QDirModel.remove (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>index</i>)</h3><p>Removes the model item <i>index</i> from the directory model and
<b>deletes the corresponding file from the file system</b>,
returning true if successful. If the item cannot be removed, false
is returned.</p>
<p><b>Warning:</b> This function deletes files from the file
system; it does <b>not</b> move them to a location where they can
be recovered.</p>
<p><b>See also</b> <a href="qdirmodel.html#rmdir">rmdir</a>().</p>


<h3 class="fn"><a name="resolveSymlinks" />bool QDirModel.resolveSymlinks (<i>self</i>)</h3><h3 class="fn"><a name="rmdir" />bool QDirModel.rmdir (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>index</i>)</h3><p>Removes the directory corresponding to the model item
<i>index</i> in the directory model and <b>deletes the
corresponding directory from the file system</b>, returning true if
successful. If the directory cannot be removed, false is
returned.</p>
<p><b>Warning:</b> This function deletes directories from the file
system; it does <b>not</b> move them to a location where they can
be recovered.</p>
<p><b>See also</b> <a href="qdirmodel.html#remove">remove</a>().</p>


<h3 class="fn"><a name="rowCount" />int QDirModel.rowCount (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>parent</i>&#160;=&#160;QModelIndex())</h3><p>Reimplemented from <a href="qabstractitemmodel.html#rowCount">QAbstractItemModel.rowCount</a>().</p>
<p>Returns the number of rows in the <i>parent</i> model item.</p>


<h3 class="fn"><a name="setData" />bool QDirModel.setData (<i>self</i>, <a href="qmodelindex.html">QModelIndex</a>&#160;<i>index</i>, QVariant&#160;<i>value</i>, int&#160;<i>role</i>&#160;=&#160;Qt.EditRole)</h3><p>Reimplemented from <a href="qabstractitemmodel.html#setData">QAbstractItemModel.setData</a>().</p>
<p>Sets the data for the model item <i>index</i> with the given
<i>role</i> to the data referenced by the <i>value</i>. Returns
true if successful; otherwise returns false.</p>
<p><b>See also</b> <a href="qdirmodel.html#data">data</a>() and
<a href="qt.html#ItemDataRole-enum">Qt.ItemDataRole</a>.</p>


<h3 class="fn"><a name="setFilter" />QDirModel.setFilter (<i>self</i>, <a href="qdir-filters.html">QDir.Filters</a>&#160;<i>filters</i>)</h3><p>Sets the directory model's filter to that specified by
<i>filters</i>.</p>
<p>Note that the filter you set should always include the <a href="qdir.html#Filter-enum">QDir.AllDirs</a> enum value, otherwise
<a class="obsolete" href="qdirmodel.html">QDirModel</a> won't be
able to read the directory structure.</p>
<p><b>See also</b> <a href="qdirmodel.html#filter">filter</a>() and
<a href="qdir.html#Filter-enum">QDir.Filters</a>.</p>


<h3 class="fn"><a name="setIconProvider" />QDirModel.setIconProvider (<i>self</i>, <a href="qfileiconprovider.html">QFileIconProvider</a>&#160;<i>provider</i>)</h3><p>Sets the <i>provider</i> of file icons for the directory
model.</p>
<p><b>See also</b> <a href="qdirmodel.html#iconProvider">iconProvider</a>().</p>


<h3 class="fn"><a name="setLazyChildCount" />QDirModel.setLazyChildCount (<i>self</i>, bool&#160;<i>enable</i>)</h3><h3 class="fn"><a name="setNameFilters" />QDirModel.setNameFilters (<i>self</i>, QStringList&#160;<i>filters</i>)</h3><p>Sets the name <i>filters</i> for the directory model.</p>
<p><b>See also</b> <a href="qdirmodel.html#nameFilters">nameFilters</a>().</p>


<h3 class="fn"><a name="setReadOnly" />QDirModel.setReadOnly (<i>self</i>, bool&#160;<i>enable</i>)</h3><h3 class="fn"><a name="setResolveSymlinks" />QDirModel.setResolveSymlinks (<i>self</i>, bool&#160;<i>enable</i>)</h3><h3 class="fn"><a name="setSorting" />QDirModel.setSorting (<i>self</i>, <a href="qdir-sortflags.html">QDir.SortFlags</a>&#160;<i>sort</i>)</h3><p>Sets the directory model's sorting order to that specified by
<i>sort</i>.</p>
<p><b>See also</b> <a href="qdirmodel.html#sorting">sorting</a>()
and <a href="qdir.html#SortFlag-enum">QDir.SortFlags</a>.</p>


<h3 class="fn"><a name="sort" />QDirModel.sort (<i>self</i>, int&#160;<i>column</i>, <a href="qt.html#SortOrder-enum">Qt.SortOrder</a>&#160;<i>order</i>&#160;=&#160;Qt.AscendingOrder)</h3><p>Reimplemented from <a href="qabstractitemmodel.html#sort">QAbstractItemModel.sort</a>().</p>
<p>Sort the model items in the <i>column</i> using the <i>order</i>
given. The order is a value defined in <a href="qt.html#SortOrder-enum">Qt.SortOrder</a>.</p>


<h3 class="fn"><a name="sorting" /><a href="qdir-sortflags.html">QDir.SortFlags</a> QDirModel.sorting (<i>self</i>)</h3><p>Returns the sorting method used for the directory model.</p>
<p><b>See also</b> <a href="qdirmodel.html#setSorting">setSorting</a>() and <a href="qdir.html#SortFlag-enum">QDir.SortFlags</a>.</p>


<h3 class="fn"><a name="supportedDropActions" /><a href="qt-dropactions.html">Qt.DropActions</a> QDirModel.supportedDropActions (<i>self</i>)</h3><p>Reimplemented from <a href="qabstractitemmodel.html#supportedDropActions">QAbstractItemModel.supportedDropActions</a>().</p>
<p>Returns the drop actions supported by this model.</p>
<p><b>See also</b> <a href="qt.html#DropAction-enum">Qt.DropActions</a>.</p>
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.9.1 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2011</td><td align="right" width="25%">Qt&#160;4.8.0</td></tr></table></div></address></body></html>